namespace hjc {

    export class Destin extends Component {

        private $target: Position | Entity | AStarNode | angle;
        public get target(): Position | Entity | AStarNode | angle { return this.$target }
        public set target(target: Position | Entity | AStarNode | angle) {
            if (target !== this.$target) {
                if (!!target) this.emit(Func.Entity.onDestinChanged, target, this.$target);
                this.$target = target;
            }
        }

        public init(target?: Position | Entity | AStarNode | angle): void {
            this.$target = null;
            super.resetPfc();
            if (!!target) this.target = target;
        }
    }
}